/*
 * @Author: szx
 * @Date: 2021-11-06 13:31:24
 * @LastEditTime: 2021-11-06 13:40:55
 * @Description:
 * @FilePath: \leetcode\1-99\70\70.cpp
 */
#include <iostream>
using namespace std;

class Solution {
public:
    int climbStairs(int n) {
        int p = 0, q = 0, r = 1;
        for (int i = 1; i <= n; ++i) {
            p = q; 
            q = r; 
            r = p + q;
        }
        return r;
    }
};
